<?php
	class xl_danh_gia_dia_diem extends database
	{
		/*khánh*/
		function layDiemDanhGia($id)
		{
			$this->setQuerry('select DiemDanhGia from danhgiadiadiem where MaDiaDiem = $id');
			$result = $this->loadAllRow();
			return $result;
		}
		function layDanhGia($id,$iduser){
			$this->setQuerry('SELECT MaDanhGia FROM danhgiadiadiem WHERE MaNguoiDung = $iduser AND MaDiaDiem = $id');
			$result = $this->loadAllRow();
			return $result;
		}
		/*end*/
		function danhSachDanhGiaDiaDiem()
		{
			$this->setQuerry('select * from danhgiadiadiem');
			$result = $this->loadAllRow();
			return $result;
		}
		function themDanhGiaDiaDiem($madiadiem,$manguoidung,$diemdanhgia)
		{
			$this->setQuerry("insert into danhgiadiadiem values('$madiadiem','$manguoidung','$diemdanhgia')");
			$result=$this->querry();
			return $result;
		}
		function capNhatDanhGiaDiaDiem($madanhgia,$madiadiem,$manguoidung,$diemdanhgia)
		{
			$this->setQuerry("update danhgiadiadiem set MaDiaDiem=$madiadiem, MaNguoiDung=$manguoidung, DiemDanhGia=$diemdanhgia where MaDanhGia=$madanhgia");
			$result=$this->querry();
			return $result;
		}
		function xoaDanhGiaDiaDiem($madanhgia)
		{
			$this->setQuerry("delete from danhgiadiadiem where MaDanhGia=$madanhgia");
			$result=$this->querry();
			return $result;
		}
	}
	
?>